package com.weimob.xhx.controller;


import com.weimob.xhx.entities.User;
import com.weimob.xhx.entities.User_01;
import com.weimob.xhx.mapper.UserMapper;
import com.weimob.xhx.mapper.User_01Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: xhx-mybatis-generator
 * @description:
 * @author: sch
 * @create: 2022-12-09 23:34
 **/
@RequestMapping("generator")
@RestController
public class TestController {
    @Autowired
    private UserMapper userMappper;
    @Autowired
    private User_01Mapper user_01Mapper;

    /**
     * 查询所有用户信息
     */
    @RequestMapping("/selectUserList")
    public List<User> selectUserList() {
        List<User> users = userMappper.selectUserList();
        return users;
    }

    /**
     * 查询所有用户信息
     */
    @RequestMapping("/selectByPrimaryKey")
    public User_01 selectUserList(Integer id) {
        User_01 user_01 = user_01Mapper.selectByPrimaryKey(id);
        return user_01;
    }

    @RequestMapping("hello")
    public String testHello() {
        return "hello world";
    }
}
